package br.com.sgo.util.hibernate;

import javax.annotation.PostConstruct;

import org.hibernate.cfg.Configuration;

import br.com.caelum.vraptor.ioc.ApplicationScoped;
import br.com.caelum.vraptor.ioc.Component;
import br.com.caelum.vraptor.ioc.ComponentFactory;

@Component
@ApplicationScoped
public class ConfigurationCreator implements ComponentFactory<Configuration> {

	private Configuration cfg;

	@PostConstruct
	protected void create() {
		this.cfg = new Configuration().configure();
		configureExtras();
	}
	
	private void configureExtras() {
	}

	public Configuration getInstance() {
		 return this.cfg;
	}

}
